package com.qyc.Microservice.interceptor.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.qyc.Microservice.interceptor.ResponseResultInterceptor;

@Configuration
public class ResponseResultInterceptorConfig implements WebMvcConfigurer {

	@Autowired
	public ResponseResultInterceptor responseResultInterceptor;
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		String[] filterPath = {
		          "/**"
		        };
		registry.addInterceptor(responseResultInterceptor).addPathPatterns(filterPath);
		WebMvcConfigurer.super.addInterceptors(registry);
	}
}
